from typing import List
import json



# 方法一：模拟
class Bank:

    def __init__(self, balance: List[int]):
        self.balance = balance

    def transfer(self, account1: int, account2: int, money: int) -> bool:
        if account1 > len(self.balance) or account2 > len(self.balance) or \
                self.balance[account1 -1] < money:
            return False
        self.balance[account1 - 1] -= money
        self.balance[account1 - 1] += money

    def deposit(self, account: int, money: int) -> bool:
        if account > len(self.balance):
            return False
        self.balance[account - 1] += money
        return True


    def withdraw(self, account: int, money: int) -> bool:
        if account > len(self.balance) or self.balance[account - 1] < money:
            return False
        self.balance[account - 1] -= money
        return True


def main():
    import sys
    import io
    def readlines():
        for line in io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8'):
            yield line.strip('\n')

    lines = readlines()
    while True:
        try:
            line = next(lines)
            balance = json.loads(line)
            bank = Bank(balance)
            # 再写输入……
        except StopIteration:
            break


if __name__ == '__main__':
    main()
    